Can I safely upgrade to El Capitan? I have several large iPhoto libraries and switch often between them. I do not want to switch to the Photos app.
The first thing to check is if you can update to iPhoto 9.6.1, as Larry pointed out. You can install the 9.6.1 update only after upgrading to El Capitan, and then it will be too late, if you find that iPhoto 9.6.1 is not available for you.
Read Barney's user tip to check, if you can upgrade.
If you bought iPhoto from the App Store, or it came preinstalled with OS X Lion or later, it should be possible.
The problem is, that Apple stopped selling iPhoto and updating iPhoto is only possible by reinstalling from the AppStore. So check if iPhoto is in your Purchases history.